#include "selectServer.hpp"
#include <memory>

using namespace select_ns;


static void Usage(const std::string& proc)
{
    std::cerr << "Usage:\n\t" << proc << " port" << std::endl;
}

std::string transaction(const std::string& request)
{
    // TODO
    return request;
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    uint16_t port = atoi(argv[1]);
    std::unique_ptr<SelectServer> usvr(new SelectServer(transaction, port));

    usvr->initServer();

    usvr->start();

    return 0;
}